package br.eti.robsonfranca.clf4j.interfaces.win;

import br.eti.robsonfranca.clf4j.impl.win.ConsoleCursorInfo;
import br.eti.robsonfranca.clf4j.impl.win.ConsoleScreenBufferInfo;
import br.eti.robsonfranca.clf4j.impl.win.Coord;
import br.eti.robsonfranca.clf4j.impl.win.SmallRect;

import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;

public interface Kernel32 extends StdCallLibrary {
		
	Kernel32 INSTANCE = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class);
	
	boolean SetConsoleTextAttribute(Pointer handle, short attribute);
    boolean SetConsoleCursorPosition(Pointer handle, Coord.ByValue coord);
    boolean GetConsoleScreenBufferInfo(Pointer handle, ConsoleScreenBufferInfo lpConsoleScreenBufferInfo);
    Pointer GetStdHandle(int nStdHandle);
    boolean WriteConsoleW(Pointer handle, char[] buffer, int numChars, IntByReference nobw, Pointer reserved );
    boolean SetConsoleScreenBufferSize(Pointer handle, Coord.ByValue dwSize);
    boolean SetConsoleWindowInfo(Pointer handle, boolean bAbsolute, SmallRect consoleWindow);
    boolean WriteConsoleOutputCharacterW(Pointer handle, char[] lpCharacter, int length, Coord.ByValue writeCoord, IntByReference nobw);
    boolean GetConsoleCursorInfo(Pointer handle, ConsoleCursorInfo info);
    boolean SetConsoleCursorInfo(Pointer handle, ConsoleCursorInfo info);
    boolean ReadConsoleW(Pointer handle, char[] lpBuffer, int nNumberOfCharsToRead, IntByReference nocr, Pointer inputControl);
/*
 * typedef struct _CONSOLE_CURSOR_INFO {
  DWORD dwSize;
  BOOL  bVisible;
} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO;    
 */
}
